package com.wtzz.police.base;

import com.wtzz.police.base.repository.base.BaseRepositoryFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@ComponentScan({"com.wtzz.police.base.controller", //
                "com.wtzz.police.base.config", //
                "com.wtzz.police.base.service", //
                "com.wtzz.police.base.util.component",//
                "com.wtzz.police.base.aop"//
               })
@SpringBootApplication
@EnableJpaRepositories(value = {"com.wtzz.police.base.repository", "com.wtzz.police.base.repository.base"},
                       repositoryFactoryBeanClass = BaseRepositoryFactoryBean.class)
@EntityScan({"com.wtzz.police.base.entity"})
@EnableCaching
public class Application extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }

}
